/* 全局字體與樣式 */
body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
}

<style>
    /* 全局樣式 */
    body {
        margin: 0;
        padding: 0;
        font-family: Arial, sans-serif;
    }

    header, footer {
        width: 100%;
        text-align: center;
        background-color: #f8f8f8;
        padding: 20px 0;
    }

    main {
        max-width: 1200px; /* 限制內容的最大寬度 */
        margin: 0 auto;
        padding: 20px; /* 內縮 20px，讓內容不貼邊 */
    }

    /* 展覽列表樣式 */
    .exhibition-list {
        display: flex;
        flex-wrap: wrap; /* 啟用換行 */
        gap: 20px; /* 每個展覽間的間距 */
        justify-content: space-between; /* 項目均勻分布 */
    }

    .exhibition {
        flex: 1 1 calc(33.333% - 20px); /* 每行最多 3 項，並考慮間距 */
        box-sizing: border-box;
        background-color: #fff;
        border: 1px solid #ddd;
        padding: 10px;
        border-radius: 8px; /* 增加圓角 */
        margin-bottom: 20px; /* 每個項目底部的間距 */
        text-align: center; /* 文字置中 */
    }

    .exhibition img {
        width: 100%; /* 圖片寬度適應容器 */
        height: auto; /* 保持比例 */
        border-radius: 8px;
        margin-bottom: 10px; /* 圖片與文字間距 */
    }

    .exhibition h3 {
        font-size: 1.2rem;
        margin: 10px 0 5px;
    }

    .exhibition p {
        font-size: 0.9rem;
        color: #666;
    }

    /* 回頁首的樣式 */
    .back-to-top-text {
        text-align: center;
        margin-top: 20px;
    }

    a {
        text-decoration: none;
        color: #007bff;
    }

    a:hover {
        text-decoration: underline;
    }

    /* 小螢幕調整 */
    @media (max-width: 768px) {
        .exhibition {
            flex: 1 1 calc(50% - 20px); /* 每行 2 個 */
        }
    }

    @media (max-width: 480px) {
        .exhibition {
            flex: 1 1 100%; /* 每行 1 個 */
        }
    }
</style>


/* Header 樣式 */
header {
    background-color: #f9f9f9;
    padding: 40px 20px;
    border-bottom: 2px solid #ddd;
    text-align: center;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.logo {
    width: 100px;
    height: auto;
}

h1 {
    margin: 0;
    font-size: 2rem;
    color: #333;
}

p {
    margin: 10px 0 0;
    font-size: 1rem;
    color: #666;
}

/* 年份導航欄 */
.year-navigation {
    display: grid;
    grid-template-columns: repeat(10, 1fr); /* 每行顯示 10 個年份 */
    gap: 10px; /* 每個項目之間的間距 */
    margin: 0 auto;
    padding: 20px;
    width: 80%; /* 調整導航欄的寬度 */
    box-sizing: border-box;
}

/* 單個年份鏈接樣式 */
.year-navigation a {
    text-decoration: none;
    color: #333;
    font-size: 1rem;
    text-align: center;
    padding: 5px 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.year-navigation a:hover {
    background-color: #333;
    color: #fff;
}

/* 響應式設計：當螢幕寬度小於 768px 時調整為每行 5 個 */
@media (max-width: 768px) {
    .year-navigation {
        grid-template-columns: repeat(5, 1fr); /* 每行顯示 5 個年份 */
    }
}

/* 響應式設計：當螢幕寬度小於 480px 時調整為每行 3 個 */
@media (max-width: 480px) {
    .year-navigation {
        grid-template-columns: repeat(3, 1fr); /* 每行顯示 3 個年份 */
    }
}


/* 展覽列表容器樣式 */
.exhibition-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 默認每行顯示 4 個展覽 */
    gap: 20px; /* 每個展覽項目之間的間距 */
    margin: 20px 0;
}

/* 響應式設計：當螢幕寬度小於 1024px 時，每行顯示 3 個展覽 */
@media (max-width: 1024px) {
    .exhibition-list {
        grid-template-columns: repeat(3, 1fr); /* 每行顯示 3 個展覽 */
    }
}

/* 響應式設計：當螢幕寬度小於 768px 時，每行顯示 2 個展覽 */
@media (max-width: 768px) {
    .exhibition-list {
        grid-template-columns: repeat(2, 1fr); /* 每行顯示 2 個展覽 */
    }
}

/* 響應式設計：當螢幕寬度小於 480px 時，每行顯示 1 個展覽 */
@media (max-width: 480px) {
    .exhibition-list {
        grid-template-columns: 1fr; /* 每行顯示 1 個展覽 */
    }
}

/* 單個展覽卡片樣式 */
.exhibition {
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.exhibition img {
    width: 100%;
    height: auto;
    border-bottom: 1px solid #ddd;
    margin-bottom: 10px;
}

.exhibition h3 {
    font-size: 1.2rem;
    margin: 10px 0;
}

.exhibition p {
    font-size: 0.9rem;
    color: #555;
}

/* 卡片效果：滑鼠懸停放大 */
.exhibition:hover {
    transform: translateY(-5px);
}

.back-to-top-text {
    text-align: center;
    margin-top: 20px;
}

.back-to-top-text a {
    text-decoration: none;
    color: inherit;  /* Ensures it does not turn blue */
}

.back-to-top-text a:hover {
    color: inherit; /* Ensures no color change on hover */
}


footer {
    text-align: center;
}

